/*
 * global.h
 *
 *  Created on: 2018年9月5日
 *      Author: ray
 */

#ifndef SYSTEM_INC_GLOBAL_H_
#define SYSTEM_INC_GLOBAL_H_

#include "TypeDefine.h"

// extern void *memset(void *dst,int val,int count);
// extern void *memcpy(void *dest,void *src,int count);
// extern int32 memcmp(void *buffer1,void *buffer2,int count);
// extern int strlen(const char * str);
extern uint16_t GetFrameName(void);
extern void GetSTM32MCUID(uint32_t *id,MCUTypedef type);
extern int RequestAddress(uint8_t COMx, uint8_t devType);
extern uint32_t DisposeMasterPortReceive(uint32_t COMx);
extern uint32_t DisposeFrame35(uint32_t COMx, void *pBuf);
extern void Sys_Restart(void);
extern uint8_t GetSubDevID(struct RS485_VarName_ST *pName);

extern void SysTimer_Init(void);
extern struct ring_buffer* ring_buffer_init(void *buffer , uint32_t size);
// extern uint32_t ring_buffer_put(struct ring_buffer *ring_buf , void *buffer , uint32_t size);
// extern uint32_t ring_buffer_get(struct ring_buffer *ring_buf , void *buffer , uint32_t size);
// extern uint32_t ring_buffer_len(const struct ring_buffer *ring_buf);
extern uint16_t CRCCheck(uint8_t *pData , uint32_t DataLength);
// extern uint32_t SetVersion(uint8_t major, uint8_t minor, uint16_t svn);

// extern uint16_t VARTable_SearchVar(uint32_t VarName);
// extern uint32_t DisposeReceiveA20(uint32_t COMx);

// extern uint32_t FindPHYVarID_by_PHYVarName(uint32_t VarName);
// extern uint32_t FindPHYVarID_by_Var485(struct RS485_VarName_ST *pRS485_VarName_st, uint8_t DevType, uint32_t COMx);
// extern uint32_t FindSubDevID(uint8_t type, uint8_t id);

void RestoreFactory(uint32_t COMx, uint8_t devType);

void AutoRequestAddresses(uint8_t COMx, uint8_t devType, uint8_t devNum);

#endif /* 05SYSTEM_INC_GLOBAL_H_ */
